package com.newretail.springboot.result;

/**
 * @author:gaoxu;
 * @Email:gaoxu@benlai.com
 * @DATE:2018-01-05
 * @version:ver1.0.0
 * @Description: 返回体
 */

public class ResultBody {

    // 响应代码
    private String code;

    // 响应消息
    private String message;

    // 响应结果
    private Object result;

    public ResultBody(ErrorInfoInterface errorInfo) {
        this.code = errorInfo.getCode();
        this.message = errorInfo.getMessage();
    }

    public ResultBody(Object result) {
        this.code = GlobalErrorInfoEnum.SUCCESS.getCode();
        this.message = GlobalErrorInfoEnum.SUCCESS.getMessage();
        this.result = result;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }
}
